package jpa.entitys.promis.construction;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the ACCOUNT_PAYABLE_VOUCHERS database table.
 * 
 */
@Embeddable
public class AccountPayableVoucherPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	private String company;
	
	private String project;

	@Column(name="VOUCHER_TYPE")
	private String voucherType;

	@Column(name="VOUCHER_SERIES")
	private String voucherSeries;

	@Column(name="VOUCHER_NUMBER")
	private long voucherNumber;

    public AccountPayableVoucherPK() {
    }
    
    
	/**
	 * @return the project
	 */
	public String getProject() {
		return project;
	}


	/**
	 * @param project the project to set
	 */
	public void setProject(String project) {
		this.project = project;
	}


	public String getCompany() {
		return this.company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getVoucherType() {
		return this.voucherType;
	}
	public void setVoucherType(String voucherType) {
		this.voucherType = voucherType;
	}
	public String getVoucherSeries() {
		return this.voucherSeries;
	}
	public void setVoucherSeries(String voucherSeries) {
		this.voucherSeries = voucherSeries;
	}
	public long getVoucherNumber() {
		return this.voucherNumber;
	}
	public void setVoucherNumber(long voucherNumber) {
		this.voucherNumber = voucherNumber;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof AccountPayableVoucherPK)) {
			return false;
		}
		AccountPayableVoucherPK castOther = (AccountPayableVoucherPK)other;
		return 
			this.company.equals(castOther.company)
			&& this.project.equals(castOther.project)
			&& this.voucherType.equals(castOther.voucherType)
			&& this.voucherSeries.equals(castOther.voucherSeries)
			&& (this.voucherNumber == castOther.voucherNumber);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.company.hashCode();
		hash = hash * prime + this.project.hashCode();
		hash = hash * prime + this.voucherType.hashCode();
		hash = hash * prime + this.voucherSeries.hashCode();
		hash = hash * prime + ((int) (this.voucherNumber ^ (this.voucherNumber >>> 32)));
		
		return hash;
    }
}